﻿using QFramework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.Tilemaps;

namespace ProjectIndieFarm
{
    public interface ITool
    {
        /// <summary>
        /// 工具名
        /// </summary>
        public string Name { get; }
        public int Range { get; }
        /// <summary>
        /// 当前工具是否可用
        /// </summary>
        public bool Selectable(ToolData data);
        /// <summary>
        /// 使用工具
        /// </summary>
        public void Use(ToolData data);
        /// <summary>
        /// 每次操作消耗的时间
        /// </summary>
        float TimeCost { get; }
        float ActionDuration { get; }
    }
    /// <summary>
    /// 工具所需参数
    /// </summary>
    public class ToolData
    {
        public EasyGrid<SoilData> SoilGrid { get; set; }
        /// <summary>
        /// 地块的格子坐标
        /// </summary>
        public Vector3Int CellPosition { get; set; }
        /// <summary>
        /// 格子中心的世界坐标
        /// </summary>
        public Vector3 WorldPosition { get; set; }
        public Tilemap Tilemap { get; set; }
        public TileBase Pen { get; set; }
    }
}
